#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <functional>
#include <boost/bind.hpp>
#include <boost/timer.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;

struct A
{
	A():a(2){}
	int a;
};

struct B:public A
{
	B():b(3){}
	int b;
};


struct C:public A
{
	C():c(4){}
	int c;
};

int main(int atrgc, char** argv)
{
	A  *pa = new C;
	B  *pb;
	pb = static_cast<B*>(pa);

	if(pb)
	       cout<<pb->b<<endl;
	else 
	       cout<<"Not a B"<<endl;	

	cout<<typeid(new A).name()<<endl;
	cout<<typeid(new B).name()<<endl;
	cout<<typeid(new C).name()<<endl;

	A aa;
	B bb;
	C cc;
	cout<<typeid(aa).name()<<endl;
	cout<<typeid(bb).name()<<endl;
	cout<<typeid(cc).name()<<endl;
	return 0;
}
